//
// Created by hsj on 2022/1/13.
//

#include <iostream>
#include "t_class_use.h"

//测试类的使用
void my_class_use_hsj::test_class_use(){

    using std::cout;
    using std::endl;

    //测试
    Time planning;
    Time coding(2,40);
    Time fixing(5,55);
    Time total;
    int m = 10;

    cout<<"planing time ...";
    planning.show();
    cout<<endl;


    cout<<"coding time ...";
    coding.show();
    cout<<endl;

    cout<<"fixing time ...";
    fixing.show();
    cout<<endl;

    total = coding.sum(fixing);
    cout<<"coding.sum(fixing) time ...";
    total.show();
    cout<<endl;

    total = coding + fixing;
    cout<<"coding + fixing time ...";
    total.show();
    cout<<endl;

    total = coding.operator+(fixing);
    cout<<"coding.operator+(fixing) time ...";
    total.show();
    cout<<endl;

    total = coding + m;
//    total = coding.operator+(m);//原理
    cout<<"coding + m time ...";
//    total.show();
    cout<<total;
    cout<<endl;

    total = m + coding;
//    total = operator+(m,coding);//原理
    cout<<"friend m * coding time ...";
//    total.show();
    cout<<total<<" 8899 is good!"<<endl;
    cout<<endl;
}